<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org">

<head>

<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>INSPINIA | Data Tables</title>

<link href="css/bootstrap.min.css" rel="stylesheet" />

<link href="css/plugins/dataTables/datatables.min.css" rel="stylesheet" />

<link href="css/animate.css" rel="stylesheet" />
<link href="css/style.css" rel="stylesheet" />

<!-- Mainly scripts -->
<script src="js/jquery-2.1.1.js"></script>
<script src="js/bootstrap.min.js"></script>


<script src="js/plugins/dataTables/datatables.min.js"></script>



<!-- Page-Level Scripts 	dom : '<"html5buttons"B>lTfgitp',-->
<script>
	$(document).ready(function() {

		/* Init DataTables */
		var oTable = $('#editable').DataTable({
			"aaSorting" : [ [ 7, "desc" ] ]
		});
	});

	function editConnectInfo() {
		window.location.href = "#modal-form";
	}
</script>
</head>

<body>
	<div id="wrapper">

		<nav class="navbar-default navbar-static-side" role="navigation">
			<div class="sidebar-collapse">
				<ul class="nav metismenu" id="side-menu">
					<li class="active"><a href="#"><i class="fa fa-table"></i>
							<span class="nav-label">消息平台代理</span><span class="fa arrow"></span></a>
						<ul class="nav nav-second-level">
							<li class="active"><a href="/mqrest/connectInfo">队列信息</a></li>
							<li class="active"><a href="/mqrest/connectInfo">系统信息</a></li>
							<li class="active"><a href="/mqrest/connectInfo">申请信息</a></li>
						</ul></li>

				</ul>

			</div>
		</nav>

		<div id="page-wrapper" class="gray-bg">
			<div class="row border-bottom"></div>
			<div class="row wrapper border-bottom white-bg page-heading">
				<div class="col-lg-10">
					<h2>消息代理平台---用户申请信息</h2>
					<ol class="breadcrumb">
						<li><a href="index.html">主页</a></li>
						<li><a>消息平台代理</a></li>
						<li class="active"><strong>问题消息</strong></li>
					</ol>
				</div>
				<div class="col-lg-2"></div>
			</div>
			<div class="wrapper wrapper-content animated fadeInRight">
				<div class="row">
					<div class="col-lg-12">
						<div class="ibox float-e-margins">
							<div class="ibox-title">
								<h5><!-- Editable Table in- combination with jEditable --></h5>
								<div class="ibox-tools">
									<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
									</a> <a class="dropdown-toggle" data-toggle="dropdown" href="#">
										<i class="fa fa-wrench"></i>
									</a>
									<ul class="dropdown-menu dropdown-user">
										<li><a href="#">Config option 1</a></li>
										<li><a href="#">Config option 2</a></li>
									</ul>
									<a class="close-link"> <i class="fa fa-times"></i>
									</a>
								</div>
							</div>
							<div class="ibox-content">
								<div>
									<a data-toggle="modal" class="btn btn-primary"
										href="#modal-form">添加申请</a>
								</div>
								<div id="modal-form" class="modal fade" aria-labelledby="connectInfo"  aria-hidden="true">
									<div class="modal-dialog">
										<div class="modal-content">
										<div class="modal-header">
												<button type="button" class="close" data-dismiss="modal"
													aria-hidden="true">&times;</button>
												<h4 class="modal-title" id="connectInfo">添加用户申请
												</h4>
											</div>
											<div class="modal-body">
												<!-- 添加信息start -->
												<form id="connectinfo" action="/mqrest/addConnectInfo"
													name="connectinfo" method="post">
													<label class=" control-label">申请人</label> <input
														type="text" id="ssss" name="applyperson"
														class="form-control" /> <label class=" control-label">联系方式</label>
													<input type="text" name="contactinfo" class="form-control" />
													<label class=" control-label">系统名称</label> <input
														type="text" name="sysname" class="form-control" /> <label
														class=" control-label">系统编码</label> <input type="text"
														name="syscode" class="form-control" /> <label
														class=" control-label">监听队列</label> <input type="text"
														name="queuename" class="form-control" /> <label
														class=" control-label">回调地址</label> <input type="text"
														name="callbackurl" class="form-control" /> <label
														class=" control-label">回调参数</label> <input type="text"
														name="callbackparam" class="form-control" />
												</form>
												<!-- 添加信息stop -->
											</div>
											<div class="modal-footer">
												<button type="button" class="btn btn-default"
													data-dismiss="modal">关闭</button>
												<button type="button" class="btn btn-primary"
													onclick="addConnectInfo()">提交更改</button>
											</div>
										</div>
									</div>
								</div>

								<table class="table table-striped table-bordered table-hover "
									id="editable">

									<thead>
										<tr>
											<th>系统名称</th>
											<th>系统编码</th>
											<th>申请人</th>
											<th>联系方式</th>
											<th>队列名称</th>
											<th>回调地址</th>
											<th>回调参数</th>
											<th>更新时间</th>
											<th>状态</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody>
										<tr class="gradeA" th:each="connectinfor : ${connectInfors}">
											<td th:text="${connectinfor.sysname}">无</td>
											<td th:text="${connectinfor.syscode}">无</td>
											<td th:text="${connectinfor.applyperson}">无</td>
											<td th:text="${connectinfor.contactinfo}">无</td>
											<td th:text="${connectinfor.queuename}"></td>
											<td th:text="${connectinfor.callbackurl}"></td>
											<td th:text="${connectinfor.callbackparam}"></td>
											<td th:text="${connectinfor.updatetime}" ></td>

											<td th:switch="${connectinfor.state}"><b> <span
													th:case="1">已开启</span> <span th:case="0">未开启</span>
											</b></td>
											<td th:switch="${connectinfor.state}" ><a
												role="button" class="btn btn-default btn-sm" th:case="0"
												th:href="@{/startOrStopConsume(id=${connectinfor.id})}">开启</a>

												<a role="button" class="btn btn-primary btn-sm" th:case="1"
												th:href="@{/startOrStopConsume(id=${connectinfor.id})}">关闭</a>
											<!-- 	<a role="button" class="btn btn-primary btn-sm"
												data-toggle="modal" data-target="#myModal">更改</a> --></td>
										</tr>
									</tbody>
								</table>
								<!-- 模态框（Modal）start -->
								<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
									aria-labelledby="myModalLabel" aria-hidden="true">
									<div class="modal-dialog">
										<div class="modal-content">
											<div class="modal-header">
												<button type="button" class="close" data-dismiss="modal"
													aria-hidden="true">&times;</button>
												<h4 class="modal-title" id="myModalLabel">模态框（Modal）标题
												</h4>
											</div>
											<div class="modal-body">
											<label class=" control-label">申请人</label> <input
														type="text" id="ssss" name="applyperson"
														class="form-control" /> <label class=" control-label">联系方式</label>
													<input type="text" name="contactinfo" class="form-control" />
													<label class=" control-label">系统名称</label> <input
														type="text" name="sysname" class="form-control" /> <label
														class=" control-label">系统编码</label> <input type="text"
														name="syscode" class="form-control" /> <label
														class=" control-label">监听队列</label> <input type="text"
														name="queuename" class="form-control" /> <label
														class=" control-label">回调地址</label> <input type="text"
														name="callbackurl" class="form-control" /> <label
														class=" control-label">回调参数</label> <input type="text"
														name="callbackparam" class="form-control" />
											
											</div>
											<div class="modal-footer">
												<button type="button" class="btn btn-default"
													data-dismiss="modal">关闭</button>
												<button type="button" class="btn btn-primary">提交更改
												</button>
											</div>
										</div>
										<!-- /.modal-content -->
									</div>
									<!-- /.modal -->
								</div>
								<!-- 模态框（Modal）stop -->
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

	</div>
</body>

</html>
